<div class="attribute size">
    <?php 
        $escaper = new Zend\Escaper\Escaper('utf-8');
    
        // Attribute title
        echo sprintf('<div class="attribute_title">%s</div>', $this->attribute['text']);  
        
        // Attribute values
        echo '<ul>';
        
        foreach ($this->values as $value)
            echo sprintf('<li><input type="radio" class="size_value" value="%s" name="attribute_%s" %s attributeValueId="%s">%s</input></li>', $value['id'], $this->attribute['id'], $value['is_default'] ? 'checked' : '', 
                  $value['id'], $value['text']);
        
        echo '</ul>';
    ?>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $('.size_value').change(function() {
            var selectedSize = $(this);
            
            $(document).trigger('product_attribute_value_changed', [ selectedSize.attr('attributeValueId') ]);
        });
    });
</script>
